package com.service.sys.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.entity.sys.Suggest;
import com.mapper.sys.SuggestMapper;
import com.service.sys.SuggestService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author clay
 * @since 2022-03-08
 */
@Service
public class SuggestServiceImpl extends ServiceImpl<SuggestMapper, Suggest> implements SuggestService {
    @Resource
    private SuggestMapper suggestMapper;

    @Override
    public List<Suggest> select(Suggest suggest) {
        QueryWrapper<Suggest> wrapper = new QueryWrapper<>();
        wrapper.eq(
                Objects.nonNull(suggest.getStatu()),
                "statu",
                suggest.getStatu()
        ).eq(
                Objects.nonNull(suggest.getCreateBy()),
                "create_by",
                suggest.getCreateBy()
        ).eq(
                Objects.nonNull(suggest.getUpdateBy()),
                "update_by",
                suggest.getUpdateBy()
        );
        return suggestMapper.selectList(wrapper);
    }
}
